<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" 	prefix="s"%>
<%@ taglib uri="/sys-tags" prefix="sys" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="UTF-8">
<title><s:text name="title_goodsInfoPage"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<base target="_self" />

<%@ include file="../common/header.jsp"%>
<link rel="stylesheet" type="text/css" href="${appPath}/css/goods.css" />
<script type="text/javascript" src="${appPath}/js/goods.js"></script>
<script type="text/javascript" src="${appPath}/js/area.js"></script>
<link href="${appPath}/css/nav.css"rel="stylesheet" type="text/css" />
<script type="text/javascript">

function selectArea(areaID,languageID){
	//alert(areaID+" "+languageID);
	document.getElementById("selectedAreaID").value = areaID;
}


</script>
</head>
<%-- <h1><font color="#FF0000"><s:fielderror></s:fielderror></font></h1> --%>
<body>
<%@ include file="../common/nav.jsp" %>
<div id="content1" class="content">
<p class="space2"></p>
<h1 class="font2" style="margin-left:50px"><s:text name="label_goodsInfoList"/>
&nbsp;&nbsp;&nbsp;&nbsp;</h1>
<p align="right">
<!-- <input type="button" value="返回" style="margin-left: 60px" class="button1"  id="returnBt"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 --><input type="button" value="<s:text name="button_addGoods"/>" style="margin-right: 60px" class="button1"  id="addGoodsInitBt"/>
</p>
<hr width="860px">
<p class="space1"></p>
<table style="background: white; width:860px;margin-left: auto; margin-right: auto;" cellspacing="0">
<thead>
<tr bgcolor="#bbbbbb">
<td height="60px" width="192px" align="center" class="font1"><s:text name="label_goodsId"/></td>
<td width="192px" align="center" class="font1"><s:text name="label_goodsName"/></td>
<td width="192px" align="center" class="font1"><s:text name="label_goodsArea"/></td>
<td width="192px" align="center" class="font1" ><s:text name="label_goodsPrice"/></td>
<td width="192px" align="center" class="font1"></td>
</tr>
</thead>
<tbody >
<s:iterator value="goodsList" id="goodsList" status="listStatus">

	<!--  
	<s:if test="%{#goodsList.language_id=='ja'}">
	<td width="192px" align="center">
	<sys:image width="100" height="100" imagePath="/goodsPhotos/${goods_id}/jp/${goods_img}"/>
	<%-- <img alt="<s:property value="goods_img"/>" class="resourceTypeImg"  width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goods_id"/>/jp/<s:property value="goods_img"/>"/>
	 --%></td>		
	</s:if>
	<s:elseif  test="%{#goodsList.language_id=='zh-Hans'}">
	<td width="192px" align="center">
	<sys:image width="100" height="100" imagePath="/goodsPhotos/${goods_id}/zh/${goods_img}"/>
	<%-- <img alt="<s:property value="goods_img"/>" class="resourceTypeImg"  width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goods_id"/>/zh/<s:property value="goods_img"/>"/>
	 --%></td>		
	</s:elseif >
	<s:elseif  test="%{#goodsList.language_id=='en'}">
	<td width="192px" align="center">
	<sys:image width="100" height="100" imagePath="/goodsPhotos/${goods_id}/en/${goods_img}"/>
	<%-- <img alt="<s:property value="goods_img"/>" class="resourceTypeImg"  width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goods_id"/>/en/<s:property value="goods_img"/>"/>
	 --%></td>		
	</s:elseif >
	<s:else>
	<td width="192px" align="center"></td>
	</s:else>
	-->
	<s:if test="#listStatus.odd == true">
		<tr bgcolor="#f1f1f1">
	<td width="192px" align="center">
	<div class="imgborder1">
	<sys:image width="100" height="100" imagePath="/${goods_img}"/>
	</div>
	</td>
	<td width="192px" align="center"><s:label value="%{name}"/>  </td>
	<td width="192px" align="center"><s:label value="%{area_name}"/>  </td>
	<td width="192px" align="center"><s:label value="%{price}"/><s:label value="%{currency_mark}"/>   </td>
	<td width="192px" align="center"><a href="#"  class="modifyGoodsInfoInit"><s:text name="label_modify"/></a><s:hidden value="%{goods_id}"/><s:hidden value="%{language_id}"/></td>
	</tr>
	
	</s:if>
	<s:else>

		<tr bgcolor="#cccccc">
	<td width="192px" align="center">
	<div class="imgborder2">
	<sys:image width="100" height="100" imagePath="/${goods_img}"/>
	</div>
	</td>
	<td width="192px" align="center"><s:label value="%{name}"/>  </td>
	<td width="192px" align="center"><s:label value="%{area_name}"/>  </td>
	<td width="192px" align="center"><s:label value="%{price}"/><s:label value="%{currency_mark}"/>   </td>
	<td width="192px" align="center"><a href="#"  class="modifyGoodsInfoInit"><s:text name="label_modify"/></a><s:hidden value="%{goods_id}"/><s:hidden value="%{language_id}"/></td>
	<!-- <td>${selectedAreaID}</td> -->
	<!-- add by hmh -->
	<s:hidden id="childId" value="%{selectedAreaID}"/>
	<s:hidden id="mapFlag" value="%{mapFlag}"/>
	</tr>
	</s:else>
</s:iterator>
</tbody>
</table>
<p class="space1"></p>
</div>
<div id="content2" class="content" style="display: none;">
<p class="space2"></p>
<h1 class="font2" style="margin-left:50px"><s:text name="label_editGoods"/>&nbsp;&nbsp;&nbsp;&nbsp;</h1>
<hr width="860px">
<p class="space1"></p>
<s:form id="goodsForm"  enctype="multipart/form-data" method="post" >
<table>
									<tr>
						<td width="150px" align="right" class="font1" >
						
							<s:text name="label_area"></s:text>&nbsp;&nbsp;&nbsp;&nbsp;
			
						
				
							</td>
						    <td width="810px" align="left">
							<div id="selectmapArea">
							<div id="backButton"></div>
											
							<div id="selectedInfo"></div>
							<sys:image imagePath="/area/world.jpg\" id=\"areimg\"  usemap=\"#areaMap" ></sys:image>
							<!-- 
							<img alt="map" src="${appPath}/resource_img/area/world.jpg" usemap="#areaMap" id="areimg"  class="aa"/>
							 -->
				            
				            <map name="areaMap" id="areaMap" class="aa"  >
				            </map>
			
							</div>
							<div id="areaName"></div>
						</td>				
					</tr>
					<tr>
						<td width="150px" height="20px" align="right" class="font1" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td width="810px" align="left">
						<s:fielderror fieldName="selectedAreaID" cssClass="checkmessage"></s:fielderror>
						</td>
					</tr>
					</table>
					<p class="space1"></p>
<table>
<s:actionerror></s:actionerror>					
<tr>
<td align="right" class="font1" width="150px"><s:text name="label_goodsLanguage"/>&nbsp;&nbsp;&nbsp;&nbsp; </td>
<td width="810px">
<div class="language" id="language1">日本語</div>
<div class="language" id="language2">簡体中文</div>
<div class="language" id="language3">English</div>
</td>
</tr>

<tr>
<s:hidden name="goodsIdForModify" id="goodsIdForModify" value="%{goodsIdForModify}"/>
<s:hidden name="languageIdForModify" id="languageIdForModify" value="%{languageIdForModify}"/>
<s:hidden name="selectedAreaID" id="selectedAreaID" />
<s:hidden name="addGoodsFlag" id="addGoodsFlag"/>
<s:hidden name="selectLanguageFlag" id="selectLanguageFlag"/>
<s:hidden name="file1FileUrl"/>
<s:hidden name="file2FileUrl"/>
<s:hidden name="file3FileUrl"/>
<!-- 语言切换 -->
<td width="150px"></td>
<td width="810px" align="left">
<!-- 语言切换DIV1 -->
<div class="languageGood" id="languageGood1">
<table>
<tr>
<td width="200px" height="50px" align="right"class="font1">商品名&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:textfield id="goodsName1" name="goodsName1" value="%{goodsName1}" maxlength="20"/>
<s:fielderror fieldName="goodsName1" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">価額&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:textfield id="goodsPrice1" name="goodsPrice1" value="%{goodsPrice1}" maxlength="8"/>  円
<s:fielderror fieldName="goodsPrice1" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="150px" align="right"class="font1">説明&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<s:textarea id="description1" cols="50" rows="8" name="description1" value="%{description1}" maxlength="200"/>
<s:fielderror fieldName="description1" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right" class="font1">商品写真&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:file name="file1" theme="simple"></s:file>
<s:fielderror fieldName="file1FileName" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px"></td>
<s:set name="fileName1" value="%{file1FileName}" />
<s:if test="file1FileUrl==null or file1FileUrl==''">
<!-- <td width="560px" height="40px" colspan="3" align="left">商品写真はありません、アップロードしてください。</td> -->
</s:if>
<s:else>
<td width="560px" height="40px" colspan="3" align="left" id="imgFile1TD">
<%-- <img id="imgFile1IMG" alt=""  width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goodsIdForModify"/>/jp/<s:property value="file1FileName"/>"/>

 <sys:image width="100" height="100" imagePath="/goodsPhotos/${goodsIdForModify}/jp/${file1FileName}"/>

  --%>
   <sys:image width="100" height="100" imagePath="/${file1FileUrl}"/>
</td>
</s:else>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">状態&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>  <s:radio id="status1" name="status1" list="%{#{'1':'利用可','0':'利用不可'}}" value="%{status1}" theme="simple"></s:radio> 
</td>
</tr>


<!--  -->

<tr>

<td width="200px" height="50px" align="right"class="font1">タグ&nbsp;&nbsp;&nbsp;&nbsp;

<input type="hidden" id="tagValue"   value="スキー,たこ焼き,水族館 "/>

</td>
<td>
<div  class="txtdiv" id="tagdiv">
<div class="tinputdiv"><input type="text"  maxlength="10" class="tinput" onkeyup="txtInput()" onclick="showTagInfo()" /> </div>

</div>
</td>
</tr>

<tr>
<td>
</td>
<td>
<div id="selectTagInfo">
<table  id="tablediv" >
<tr >

<td colspan="2" width="500px" height="50px" align="left"class="font2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;标签间请用“空格”或“逗号”隔开，最多可添加5个标签
<div class="deletediv"><a onclick="hideTagInfo()">&times;</a></div>

</td>
</tr>
<tr>
<td height="50px" width="80px" align="right"class="font2">常用のタグ</td>
<td>
<div class="tagdiv"><a class="selectTag" onclick="selectTag(this)">ビーチ</a></div>
<div class="tagdiv"><a class="selectTag" onclick="selectTag(this)">潜水</a></div>
<div class="tagdiv"><a class="selectTag" onclick="selectTag(this)">水族館</a></div>
<div class="tagdiv"><a class="selectTag" onclick="selectTag(this)">世界遺産</a></div>
<div class="tagdiv"><a class="selectTag" onclick="selectTag(this)">動物園</a></div>


</td>
</tr>
<tr>
<td height="50px" align="right"class="font2">推薦タグ</td>
<td>
<div class="tagdiv">たこ焼き</div>
<div class="tagdiv">花見</div>
<div class="tagdiv">スキー</div>
<div class="tagdiv">お寺</div>
<div class="tagdiv">滑雪</div>



</td>
</tr>

</table>

</div>
</td>
</tr>
</table>
</div>
<!-- 语言切换DIV2 -->
<div class="languageGood" id="languageGood2" style="display: none;">
<table>
<tr>
<td width="200px" height="50px" align="right"class="font1">商品名&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:textfield id="goodsName2" name="goodsName2" maxlength="20"/>
<s:fielderror fieldName="goodsName2" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">价格&nbsp;&nbsp;&nbsp;&nbsp; </td>
<td width="560px" height="40px"><s:textfield id="goodsPrice2" name="goodsPrice2" maxlength="8"/>  元
<s:fielderror fieldName="goodsPrice2" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="150px" align="right"class="font1">商品说明&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<s:textarea id="description2" cols="50" rows="8" name="description2"/>
<s:fielderror fieldName="description2" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right" class="font1">商品图片&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:file name="file2" theme="simple"></s:file>
<s:fielderror fieldName="file2FileName" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td></td>
<s:set name="fileName2" value="%{file2FileName}" />
<s:if test="file2FileUrl==null or file2FileUrl==''">
<!-- <td width="560px" height="40px" colspan="3" align="left">没有商品图片，请上传。</td> -->
</s:if>
<s:else>
<td width="560px" height="100px" colspan="3" align="left" id="imgFile2TD">
<%-- <img id="imgFile2IMG" alt=""  width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goodsIdForModify"/>/zh/<s:property value="file2FileName"/>"/> --%>
<div style="width:100px;height:100px">
<%--  
<sys:image width="100" height="100" imagePath="/goodsPhotos/${goodsIdForModify}/zh/${file2FileName}"/>
--%>
<sys:image width="100" height="100" imagePath="${file2FileUrl}"/>
</div>
</td>
</s:else>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">状态&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td> <s:radio id="status2" name="status2" list="%{#{'1':'使用','0':'不使用'}}" value="%{status2}" theme="simple"></s:radio> </td>
</tr>

<!--   -->


</table>
</div>
<!-- 语言切换DIV3 -->
<div class="languageGood" id="languageGood3" style="display: none;">
<table>
<tr>
<td width="200px" height="50px" align="right"class="font1">name&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:textfield id="goodsName3" name="goodsName3" maxlength="20"/>
<s:fielderror fieldName="goodsName3" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">price&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:textfield id="goodsPrice3" name="goodsPrice3" maxlength="8"/>  $
<s:fielderror fieldName="goodsPrice3" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="150px" align="right"class="font1">description&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<s:textarea id="description3" cols="50" rows="8" name="description3"/>
<s:fielderror fieldName="description3" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td width="200px" height="50px" align="right" class="font1">photo&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="560px" height="40px"><s:file name="file3" theme="simple"></s:file>
<s:fielderror fieldName="file3FileName" cssClass="checkmessage"></s:fielderror>
</td>
</tr>
<tr>
<td></td>
<s:set name="fileName3" value="%{file3FileName}" />
<s:if test="file3FileUrl==null or file3FileUrl==''">
<!-- <td width="560px" height="40px" colspan="3" align="left">No photo.Please upload!</td> -->
</s:if>
<s:else>
<td width="560px" height="100px" colspan="3" align="left" id="imgFile3TD">
<%-- <img alt="" width="100" height="100" src="${appPath}/images/goodsPhotos/<s:property value="goodsIdForModify"/>/en/<s:property value="file3FileName"/>"/> --%>
<%-- 
<sys:image width="100" height="100" imagePath="/goodsPhotos/${goodsIdForModify}/en/${file3FileName}"/>
--%>
<sys:image width="100" height="100" imagePath="/${file3FileUrl}"/>
</td>
</s:else>
</tr>
<tr>
<td width="200px" height="50px" align="right"class="font1">status&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td> <s:radio id="status3" name="status3" list="%{#{'1':'used','0':'unused'}}" value="%{status3}" theme="simple"></s:radio> </td>
</tr>
</table>
</div>

</td>
</tr>
<tr>
<td colspan="2" height="10px"></td>
</tr>
<tr>
<td  align="right">
<span class="font1"><s:text name="label_goodsresource"/></span>&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td>
<table>

<s:iterator value="resourceList" id="resourceList" status="listStatus">
	<td width="100px" align="center"><s:hidden name="selectedFlg" value="0"/><a href="javascript:void(0)"  class="resourceType">
	<%-- <img id="imgFileIMG" alt=""  width="100" height="100" src="${appPath}/resource_img/resource/master/<s:property value="%{img}"/>"/> --%>
	<sys:image width="100" height="100" imagePath="/${img}"/>
	</a><s:hidden value="%{resource_type_id}"/></td>
</s:iterator>
<s:hidden name="selectedResourceTypes" id="selectedResourceTypes" value="%{selectedResourceTypes}"/>
</table>
</td>
</tr>

<tr>
<td colspan="2" height="10px"></td>
</tr>
<tr>
	<td align="right">
<span class="font1"><s:text name="label_payType"></s:text></span>&nbsp;&nbsp;&nbsp;&nbsp;
	</td>
	<td align="left">
	<s:select id="payTypeId" name="pay_type_id"
								list="payTypeMap" listKey="key" listValue="value" />
	</td>
</tr>
<tr>
<td width="480px" height="100px" align="center" colspan="2">
<input type="button"  value="<s:text name="label_SureButton"></s:text>" class="button1" id="saveGoodsBt"/>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="返回" class="button1"/> -->
</td>
</tr>
</table>


</s:form>
</div>


<p class="space1"></p>
</body>
</html>